package cn.jsprun.utils;

import java.util.Map;

import javax.servlet.ServletContext;
public final class ForumInit{
	public static Map<String, String> settings=null;
	public synchronized static void initServletContext(ServletContext context){
		settings = ForumCommonsUtil.queryForumSetInfo();
    	context.setAttribute("fsmap", settings);
	}
	public static void setSettings(ServletContext context,Map<String, String> value){
		if(value==null){
			settings = ForumCommonsUtil.queryForumSetInfo();
		}else{
			settings=value;
		}
		context.setAttribute("fsmap", settings);
		Cache cache=new Cache(context.getRealPath("/"));
		try {
			cache.updatecache("settings");
		} catch (Exception e) {
		}
		cache=null;
	}
}